package com.sbio.udiapp.util;

import android.content.Intent;

import java.util.Arrays;
import java.util.List;

public class IntentUtil {

    /**
     * 默认的broadcast，兼容两种情况
     */
    public static final String INTENT_ACTIONS_DEFAULT_1 = "com.honeywell.testbroadcast";
    public static final String INTENT_ACTIONS_DEFAULT_2 = "broadcast";

    public static final List<String> INTENT_DATA_KEY = Arrays.asList("com.symbol.datawedge.data_string", "data");

    public static String getStringExtra(Intent intent) {
        for (String s : INTENT_DATA_KEY) {
            String stringExtra = intent.getStringExtra(s);
            if (stringExtra!=null) {
                return stringExtra;
            }
        }
        return null;
    }

}
